package org.gitman.agentplatform.core;

import java.util.LinkedList;
import java.util.Queue;

public class MultiRunParameters {
	private boolean changeObserv;
	private boolean changePredict;
	private boolean changeRelie;
	
	private int minObserv;
	private int stepObserv;
	private int maxObserv;
	
	private int minPredict;
	private int stepPredict;
	private int maxPredict;
	
	private double minRelie;
	private double stepRelie;
	private double maxRelie;
	
	private boolean randOrder;
	private int randOrderNr;
	
	private Queue<Integer> observ;
	private Queue<Integer> predict;
	private Queue<Double> relie;	
	
	public MultiRunParameters() {
		changeObserv = false;
		changePredict = false;
		changeRelie = false;

		minObserv = 0;
		stepObserv = 0;
		maxObserv=0;
		
		minPredict = 0;
		stepPredict = 0;
		maxPredict = 0;
		
		minRelie = 0.0;
		stepRelie = 0.0;
		maxRelie = 0.0;
	}
	public boolean isChangeObserv() {
		return changeObserv;
	}
	public void setChangeObserv(boolean changeObserv) {
		this.changeObserv = changeObserv;
	}
	public boolean isChangePredict() {
		return changePredict;
	}
	public void setChangePredict(boolean changePredict) {
		this.changePredict = changePredict;
	}
	public boolean isChangeRelie() {
		return changeRelie;
	}
	public void setChangeRelie(boolean changeRelie) {
		this.changeRelie = changeRelie;
	}
	public int getMinObserv() {
		return minObserv;
	}
	public void setMinObserv(int minObserv) {
		this.minObserv = minObserv;
	}
	public int getStepObserv() {
		return stepObserv;
	}
	public void setStepObserv(int stepObserv) {
		this.stepObserv = stepObserv;
	}
	public int getMaxObserv() {
		return maxObserv;
	}
	public void setMaxObserv(int maxObserv) {
		this.maxObserv = maxObserv;
	}
	public int getMinPredict() {
		return minPredict;
	}
	public void setMinPredict(int minPredict) {
		this.minPredict = minPredict;
	}
	public int getStepPredict() {
		return stepPredict;
	}
	public void setStepPredict(int stepPredict) {
		this.stepPredict = stepPredict;
	}
	public int getMaxPredict() {
		return maxPredict;
	}
	public void setMaxPredict(int maxPredict) {
		this.maxPredict = maxPredict;
	}
	public double getMinRelie() {
		return minRelie;
	}
	public void setMinRelie(double minRelie) {
		this.minRelie = minRelie;
	}
	public double getStepRelie() {
		return stepRelie;
	}
	public void setStepRelie(double stepRelie) {
		this.stepRelie = stepRelie;
	}
	public double getMaxRelie() {
		return maxRelie;
	}
	public void setMaxRelie(double maxRelie) {
		this.maxRelie = maxRelie;
	}
	public boolean isRandOrder() {
		return randOrder;
	}
	public void setRandOrder(boolean randOrder) {
		this.randOrder = randOrder;
	}
	public int getRandOrderNr() {
		return randOrderNr;
	}
	public void setRandOrderNr(int randOrderNr) {
		this.randOrderNr = randOrderNr;
	}
	public int computeRunTime(){
		int runTime = 1;
		observ = new LinkedList<Integer>();
		predict = new LinkedList<Integer>();
		relie = new LinkedList<Double>();
		if(changeObserv){
			for(int i = minObserv;i<maxObserv;i+= stepObserv){
				observ.add(i);
			}			
			runTime *= observ.size();
		}else{
			observ.add(null);
		}
		if(changePredict){
			for(int i = minPredict;i<maxPredict;i+= stepPredict){
				predict.add(i);
			}
			runTime *= predict.size();
		}else{
			predict.add(null);
		}
		if(changeRelie){
			for(double i = minRelie;i<maxRelie;i+=stepRelie){
				relie.add(i);
			}
			runTime *= relie.size();
		}else{
			relie.add(null);
		}
		if(randOrder){
			runTime *= randOrderNr;
		}else{
			randOrderNr = 1;
		}
		return runTime;
	}
	public Queue<Integer> getObservQueue() {
		return observ;
	}
	public Queue<Integer> getPredictQueue() {
		return predict;
	}
	public Queue<Double> getRelieQueue() {
		return relie;
	}
	
	
}
